<%@ Page Language="C#" EnableViewState="false" ValidateRequest="false" AutoEventWireup="true" EnableEventValidation="false"
MasterPageFile="~/App_ThemeMasters/NoStyle/OneColumnLayout.Master" Inherits="Syrinx.Gui.AspNet.Ajax.NitobiBasePage" %>
<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Ajax" TagPrefix="saj" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>
<%@ Register Assembly="ScsAspNet" Namespace="Articles.Gui.AspNet" TagPrefix="art" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet" TagPrefix="syx" %>

<!--#include file="~/SiteControls/RegisterStandardControls.txt"-->
<!--#include file="~/SiteControls/StandardHeaderPageContent.inc"-->
<!--#include file="~/SiteControls/StandardFooterPageContent.inc"-->

<script runat="server">
	public string TitleFormat = "$gsplash.title$";
</script>

<asp:Content ID="c1" ContentPlaceHolderID="title" runat="server">
	<swf:BizProc ID="calEvents" runat="server" FactoryName="CalEvents">
		<State pid="AirsoftCalendar" includeLocations="true" EditModeSessionKey="GlobalEdit"  />
	</swf:BizProc>
	<swf:BizProc ID="calEvtTypes" runat="server" FactoryName="CalEventTypes">
		<State pid="AirsoftCalendar" />
	</swf:BizProc>
    <swf:BizProc ID="contacts" runat="server" FactoryName="contactBizProc">
		<State includeContactAddresses="true" EditModeSessionKey="GlobalEdit" />
		<ParentBizProc id="loginBP" />
    </swf:BizProc>
    <swf:BizProc ID="conTypeBP" runat="server" FactoryName="contactTypes">
		<ParentBizProc id="loginBP" />
    </swf:BizProc>
    <swf:BizProc ID="addrTypeBP" runat="server" FactoryName="addressTypes">
		<ParentBizProc id="loginBP" />
    </swf:BizProc>
    <swf:BizProc ID="gmapBP" runat="server" FactoryName="gmap">
		<ParentBizProc id="calEvents" dataId="dataSource" fieldName="location" meta="includeEvents"  />
		<ParentBizProc id="contacts" dataId="dataSource" fieldName="addresses" meta="includeContacts" />
		
		<ParentBizProc id="calEvtTypes" dataId="mapPin" />
		<ParentBizProc id="conTypeBP" dataId="mapPin" />
		<ParentBizProc id="addrTypeBP" dataId="mapPin" />		
    </swf:BizProc>
    <swf:BizProc ID="contactArticles" runat="server" FactoryName="genericArticles">
		<State includeSelf="false" entireTree="true" includeCounts="true" useAssociationName="Reader Comments" 
			EditModeSessionKey="GlobalEdit" incrementCounts="true" />
		<ParentBizProc id="contacts" dataId="pid" fieldName="id" />
    </swf:BizProc>
    <swf:BizProc ID="gmapSearch" runat="server" FactoryName="gmapSearch">
		<ParentBizProc id="gmapBP" dataId="pushCriteria" />
    </swf:BizProc>
    <swf:BizProc ID="calSearch" runat="server" FactoryName="CalEventSearch">
		<ParentBizProc id="calEvents" dataId="pushCriteria" />
    </swf:BizProc>
    <div style="float:right">
		<saj:ActionButton runat="server" ID="_editBtn" Actions="calEvents.SwitchEdit,contacts.SwitchEdit" Text="Edit" SessionBoolSwitch="GlobalEdit" />
    </div>
</asp:Content>

<asp:Content ID="c2" ContentPlaceHolderID="trails" runat="server">
</asp:Content>

<asp:Content ID="c3" ContentPlaceHolderID="mainContent" runat="server">
	<div class="MapSearchArea">
		<div style="float:left">
		<saj:NitobiBizObjDisplay ID="msd1" runat="server"
			ParentBizProcIds="gmapSearch"
			EditableTemplate="GoogleMap.Gui.AspNet.FullGoogleMapSearchDisplay" />
		</div>
		<div style="float:right">
		<saj:NitobiBizObjDisplay ID="msd2" runat="server"
			ParentBizProcIds="calSearch"
			EditableTemplate="Calendars.Gui.AspNet.DateRangeSearchDisplay" />
		</div>					
	</div>
	<div class="clearer"></div>
	<swf:DivLayers runat="server" ID="dl1" SkinID="MainArt1">
	<div style="float:left">
		<saj:ActionButton runat="server" ID="_upBtn" Actions="gmapSearch.UpdateBizObj,calSearch.UpdateBizObj" Text="Update Map" />
		<saj:ActionButton runat="server" ID="_restBtn" Actions="gmapSearch.CancelEdits,calSearch.CancelEdits" Text="Reset Search" />
	</div>
	<saj:NitobiGoogleMapBizObjListDisplay runat="server" id="testM" ParentBizProcIds="gmapBP" CssClass="MainMapArea"
		ShowMarkerNav="true" InitialZoom="13" PanZoom="largePanZoom" ShowMapTypes="true" Width="100%" Height="650px">
		<saj:PushPin meta="includeContacts" onclick="gmapBPBizProc.triggerEvent('ctl00_mainContent_testM','bizObjSelected','$meta$,$parentId$', function(){BasicContent=$ntb('contactDetailsBasic');DetailContent=$ntb('contactDetailsDetail');$_showTabsScript$});beforeInfoWindowClose=function(){$('#contactDetailsBasic').appendTo('#contactDetailsBasicHome');$('#contactDetailsDetail').appendTo('#contactDetailsDetailHome')}" />
		<saj:PushPin meta="includeEvents" onclick="gmapBPBizProc.triggerEvent('ctl00_mainContent_testM','bizObjSelected','$meta$,$parentId$', function(){BasicContent=$ntb('calEventDetailsBasic');DetailContent=$ntb('calEventDetailsDetail');$_showTabsScript$});beforeInfoWindowClose=function(){$('#calEventDetailsBasic').appendTo('#calEventDetailsBasicHome');$('#calEventDetailsDetail').appendTo('#calEventDetailsDetailHome')}"
			onclose="" />
	</saj:NitobiGoogleMapBizObjListDisplay>
	</swf:DivLayers>
<%--
		<saj:PushPin meta="includeContacts" onclick="gmapBPBizProc.triggerEvent('ctl00_mainContent_testM','bizObjSelected','$meta$,$parentId$');BasicContent=$('#contactDetailsBasic').html() + BasicContent + $('#contactDetailsBasicToolbar').html();" />
		<saj:PushPin meta="includeEvents" onclick="gmapBPBizProc.triggerEvent('ctl00_mainContent_testM','bizObjSelected','$meta$,$parentId$');BasicContent=$('#calEventDetailsBasic').html() + BasicContent + $('#calEventDetailsBasicToolbar').html();DetailContent=$('#calEventDetailsDetail').html() + DetailContent + $('#calEventDetailsDetailToolbar').html();" />
 --%>	
	<div id="contactDetailsBasicHome" style="position:absolute;visibility:hidden">
		<div id="contactDetailsBasic">
			<saj:NitobiBizObjDisplay runat="server" ID="conD1" ParentBizProcIds="contacts" AlwaysRefreshOnAjaxEvent="True"
				ReadOnlyTemplate="Contacts.Gui.AspNet.ContactRODisplay-NamePhoneEmail" 
				EditableTemplate="Contacts.Gui.AspNet.ContactRWDisplay-NamePhoneEmail" 
				/>
			<art:ArticleTranslationDisplay runat="server" ID="coad2"
				ParentBizProcIds="contactArticles"
				ReadOnlyTemplate="Articles.Gui.AspNet.ArticleRODisplay-SummaryOnly"
				EditableTemplate="Articles.Gui.AspNet.ArticleRWDisplay-SummaryOnly"
				/>
			<div class="GooglePopupToolbar">
				<saj:ActionButton runat="server" ID="conup1" Actions="contacts.UpdateBizObj,contactArticles.UpdateBizObj" Text="Update" />
			</div>
		</div>
	</div>

	<div id="contactDetailsDetailHome" style="position:absolute;visibility:hidden">
		<div id="contactDetailsDetail">
			<div style="max-width:410px; max-height:300px; overflow:auto;margin-right:15px;">
				<art:ArticleTranslationDisplay runat="server" ID="coad1"
					ParentBizProcIds="contactArticles" AlwaysRefreshOnAjaxEvent="True"
					ReadOnlyTemplate="Articles.Gui.AspNet.ArticleRODisplay"
					EditableTemplate="Articles.Gui.AspNet.ArticleRWDisplay-SimpleEditor-NoReparentSimpleBodyEdit" >
					<macros imageRes="Medium" />
				</art:ArticleTranslationDisplay>
			</div>
			<div class="GooglePopupToolbar">
				<saj:ActionButton runat="server" ID="_conup2" Actions="contacts.UpdateBizObj,contactArticles.UpdateBizObj" Text="Update" />
			</div>
		</div>
	</div>
	
	<div id="calEventDetailsBasicHome" style="position:absolute;visibility:hidden">
		<div id="calEventDetailsBasic">
			<art:ArticleTranslationDisplay runat="server" ID="cdet1"
				ParentBizProcIds="calEvents" AlwaysRefreshOnAjaxEvent="True"
				ReadOnlyTemplate="Calendars.Gui.AspNet.CalendarEventRODisplay"
				EditableTemplate="Calendars.Gui.AspNet.CalendarEventRWDisplay"
				>
				<macros imageRes="Thumbnail" />
			</art:ArticleTranslationDisplay>
			<div class="GooglePopupToolbar">
				<saj:ActionButton runat="server" ID="_calup1" Actions="calEvents.UpdateBizObj" Text="Update" />
			</div>
		</div>
	</div>
	
	<div id="calEventDetailsDetailHome" style="position:absolute;visibility:hidden">
		<div id="calEventDetailsDetail" style="max-width:400px; max-height:300px; overflow:auto;margin-right:15px;">
			<art:ArticleTranslationDisplay runat="server" ID="cdet2"
				ParentBizProcIds="calEvents" AlwaysRefreshOnAjaxEvent="True"
				ReadOnlyTemplate="Calendars.Gui.AspNet.CalendarEventRODisplay-BodyOnly"
				EditableTemplate="Calendars.Gui.AspNet.CalendarEventRWDisplay-BodyOnly"
				>
				<macros imageRes="Thumbnail" />
			</art:ArticleTranslationDisplay>
			<div class="GooglePopupToolbar">
				<saj:ActionButton runat="server" ID="_calup2" Actions="calEvents.UpdateBizObj" Text="Update" />
			</div>
		</div>
	</div>
</asp:Content>
